package gdut.imis.controller;

import gdut.imis.Utils.Result;
import gdut.imis.domain.FileType;
import gdut.imis.service.FileTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @Description
 * @Author JiaFu
 * @Date 2023/4/7 22:11
 */
@RestController
@RequestMapping("/file-type")
@Api(value = "档案类型接口", tags = {"档案类型接口"})
@RequiredArgsConstructor
public class FileTypeController extends BaseController {
    private final FileTypeService fileTypeService;

    @ApiOperation("新增档案类型")
    @PostMapping("/add")
    public Result add(@RequestBody FileType fileType) {
        fileTypeService.save(fileType);
        return success();
    }

    @ApiOperation("获取用户还没有申请的档案录入权限")
    @GetMapping("/getRemainFileWritePermissions")
    public Result getRemainFileWritePermissions() {
        return fileTypeService.getRemainFileWritePermissions();
    }

}
